package com.nulldev.util.osAPI.hardware.cpu;

public enum Brand {
	UNKNOWN("Unknown", -1),

	/*
	 * Intel
	 */
	Core_Series("Intel Core Series", 6),
	Core_Series_2nd_Gen_Mobile("Intel Core Series: 2nd Generation Mobile", 6, 42),

	/*
	 * AMD
	 */
	Hammer("AMD Althon 64", 15),
	K10("Phenom/Opteron", 16),
	Bobcat("AMD FX/A Series (Gen. I)", 20),
	Piledriver_Bulldozer("AMD FX/A Series (Gen. II + III)", 21),
	Jaguar("Jaguar", 22),
	Zen("Ryzen", 22),
	A_Series("AMD A Series [Gen 2]", -21),
	A_Series_G1("AMD A Series [Gen 1]", -20)

	;

	private String displayName;
	private int family;

	private Brand(final String displayName, final int family) {
		this(displayName, family, -1);
	}

	private Brand(final String displayName, final int family, final int model) {
		this.displayName = displayName;
		this.family = family;
	}

	public int getFamily() {
		return this.family;
	}

	@Override
	public String toString() {
		return this.displayName;
	}

	public String displayName() {
		return this.displayName;
	}

	public static Brand fromID(final int id) {
		for (final Brand br : values()) {
			if (br.getFamily() == id) {
				return br;
			}
		}
		System.out.println("Brand.fromID -> " + id);
		return Brand.UNKNOWN;
	}
}
